import request from '@/utils/request'

const baseUrl = '/base/paper/item/'

// 初始化页面
export function initPage(params) {
  const url = baseUrl + 'initPage'
  return request({
    url: url,
    method: 'post',
    params
  })
}

// 列表
export function loadGrid(data) {
  const url = baseUrl + 'grid'
  return request({
    url: url,
    method: 'post',
    data: data
  })
}

// 初始化编辑数据
export function initEditPage(params) {
  const actionUrl = baseUrl + 'initEditPage'
  return request({
    url: actionUrl,
    method: 'post',
    params
  })
}

// 保存、编辑
export function saveEntity(data) {
  const url = baseUrl + 'saveEntity'
  return request({
    url: url,
    method: 'post',
    data: data
  })
}

// 导出
export function exportable(data) {
  const url = baseUrl + 'exportable'
  return request({
    url: url,
    method: 'post',
    data: data
  })
}

// 导入
export function importable(data) {
  const url = baseUrl + 'importable';
  return request({
    url: url,
    method: 'post',
    data: data
  })
}
